package cn.tedu.application.service.impl;

import cn.tedu.application.mapper.ApplicationMapper;
import cn.tedu.application.pojo.dto.ApplicationParam;
import cn.tedu.application.pojo.dto.ApplicationQuery;
import cn.tedu.application.pojo.vo.ApplicationVO;
import cn.tedu.application.service.ApplicationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Slf4j
@Service
public class ApplicationServiceImpl implements ApplicationService {
    @Autowired
    private ApplicationMapper applicationMapper;

    @Override
    public List<ApplicationVO> selectInitiate(ApplicationQuery applicationQuery) {
        log.debug("【查询我发起的申请】的请求业务，参数：{}", applicationQuery);
        List<ApplicationVO> list = applicationMapper.selectInitiate(applicationQuery);
        log.debug("【查询我发起的申请】的请求业务，返回：{}", list);
        return list;
    }

    @Override
    public List<ApplicationVO> selectAudit(ApplicationQuery applicationQuery) {
        log.debug("【查询我处理的申请】的请求业务，参数：{}", applicationQuery);
        List<ApplicationVO> list = applicationMapper.selectAudit(applicationQuery);
        log.debug("【查询我处理的申请】的请求业务，返回：{}", list);
        return list;
    }

    @Override
    public void delete(ApplicationParam applicationParam) {
        log.debug("【删除流程】的请求业务，参数：{}", applicationParam);
        applicationMapper.delete(applicationParam);
    }
}